<?php
namespace app\index\controller;
use think\Controller;
use think\DB;
use think\Request;

 

class Users extends Controller
{


    public function admin_role()
    {
    	$model=new \app\index\model\Users();
        $list=$model->getRole();

        $this->assign("list",$list);
        return $this->fetch();
    }

    public function admin_role_api()
    {
    	$model=new \app\index\model\Users();
    	$list=$model->getRole();


    	return json($list);
    }

    public function admin_role_add()
    {
        
        return $this->fetch();
    }

    public function admin_role_del($id)
    {
        $model=new \app\index\model\Users();
        $result=$model->getRoledel($id);
        if($result){
            return json(['msg'=>0,'msg'=>'删除成功']);
        }
    }

    public function admin_permission()
    {
        $model=new \app\index\model\Users();
        $list=$model->getPermissionList();
        

        $this->assign("list",$list);
        return $this->fetch();
    }
}
